package com.qidian.mes.controller;

import com.qidian.mes.pojo.RouteProcess;
import com.qidian.mes.service.RouteProcessService;
import com.qidian.mes.util.pojo.MESResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/routeProcess")
@CrossOrigin
public class RouteProcessController {
    @Autowired
    private RouteProcessService routeProcessService;

    @GetMapping("/list")
    public MESResult list(Long routeId){
        return routeProcessService.list(routeId);
    }
    @PostMapping("/save")
    public MESResult save(@RequestBody RouteProcess routeProcess){
        return routeProcessService.save(routeProcess);
    }

    @DeleteMapping("/delete")
    public MESResult delete(Long recordId){
        return routeProcessService.delete(recordId);
    }

    @GetMapping("/get")
    public MESResult get(Long recordId){
        return routeProcessService.get(recordId);
    }
    @PutMapping("/update")
    public MESResult update(@RequestBody RouteProcess routeProcess){
        return routeProcessService.update(routeProcess);
    }
}
